Ext.define('Projeto.store.Images', {
	extend: 'Ext.data.Store',
	requires: 'Projeto.model.Image',
	model: 'Projeto.model.Image',
	
	proxy: {
		type: 'ajax',
		url: 'image/findAll',
		method: 'post',
		
		api: {
			read: 'image/findAll',
			update: 'image/update',
			destroy: 'image/delete',
		},

		reader: {
			type: 'json',
			root: 'result'
		},
		
		writer: {
		    type: 'json',
		    writeAllFields: true,
		    encode: true,
		    root: 'data',
			successProperty: 'success'
		}
		
	},
	
	listeners: {
		write: function(store, operation, opts) {
			console.log(store, operation, opts);
		}
	}
	
});